<?php
    require('db_connection.php');
    
    $materialID = $_GET['materialID'];
    $query = "SELECT * FROM tblcollection WHERE materialID like '$materialID'";
    $result = mysql_query($query);
    while ($row = mysql_fetch_array($result))
    {
      $type = $row['type'];
      $callNo = $row['callNo'];
      $title = $row['title'];
      $author = $row['author'];
      $libraryNo = $row['libraryNo'];
      $status = $row['status'];
      $copyNo= $row['copyNo'];
      $subject = $row['subject'];
      $edition = $row['edition'];
      $yearPub = $row['yearPub'];
      $placePub = $row['placePub'];
      $ISBN = $row['ISBN'];
      $noOfPage = $row['noOfPage'];
      $width = $row['width'];
      $length = $row['length'];
      $imgfilename = $row['imgfilename'];
      $descriptiom = $row['description'];
      $noOfDays = $row['noOfDays'];
      
    }
    
    $query2 = "SELECT * FROM tbllibrary WHERE libraryNo like $libraryNo";
    $result2 = mysql_query($query2);
    while ($row = mysql_fetch_array($result2))
    {
      $location = $row['libraryName'];
    }
    
    $query3 = "SELECT * FROM tblcirculation WHERE materialID like $materialID";
    $result = mysql_query($query3);
    while ($row = mysql_fetch_array($result))
    {
      $status = $row['status'];
    }

?>

<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>La Union Online Library System -- Details</title>
      <meta http-equiv='generator' content='PHP Designer 2005' />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>
   <body>
        <table  width='80%' align='center' cellspacing='0' cellpadding='0'>
            <tr ><td class='outerframe'>
                <table width='100%'>
                <tr>
                    <td width='100%' colspan='2' >
                    <table width='100%'><tr>
                    <td class='outerframe2' '100%'><img src ='images/banner.jpg'></td></tr></table></td></tr>
                <tr>
                    <td colspan='2' class='login'><?php require('loginout.php'); ?></td></tr>
                <tr>
                    <td width='20%' class='outerframe2' valign='top'> <?php require('menu.php'); ?></td>
                    <td class='content' width='80%' background ='images/background.jpg'>
                        <p class='titles' align='top'>Material Information</p>

                        <?php
                            echo "<form method='post' action='reserve.php?materialID=$materialID'>";
                            echo"<table width='90%' class='detail_main' align='center'>";
                            echo"<tr><td class='tableheader' colspan='3' >"."$type"." </td></tr>";
                            echo"<tr><td rowspan='11' width='23%'><img src= 'admin/images/catalog/$imgfilename' width='100%' height='100%'> </td></tr>";
                            echo"<tr><td width='20%'>Subject: </td><td class='detail'>"."$subject"."</td></tr>";
                            echo"<tr><td width='30%'>Call Number: </td><td class='detail1'>"."$callNo"."</td></tr>";
                            echo"<tr><td width='20%'>Title: </td><td class='detail'>"."$title"."</td></tr>";
                            echo"<tr><td width='20%'>Author: </td><td class='detail1'>"."$author"."</td></tr>";
                            echo"<tr><td width='20%'>Edition: </td><td class='detail'>"."$edition"."</td></tr>";
                            echo"<tr><td width='20%'>Copyright: </td><td class='detail1'>"."$yearPub"."</td></tr>";
                            echo"<tr><td width='20%'>Place of Publication:  </td><td class='detail'>"."$placePub"."</td></tr>";
                            echo"<tr><td width='20%'>ISBN: </td><td class='detail1'>"."$ISBN"."</td></tr>";
                            echo"<tr><td width='20%'>Abstract: </td><td class='detail'>"."$description"."</td></tr>";
                            echo"<tr><td width='20%'>Physical Description: </td><td class='detail1'>"."$length"." cm. X "."$width"." cm.</td></tr>";
                            echo"</table>";
                            
                            echo"<table width='90%' align='center' class='detail_main'>";
                            echo "<tr><td class='tableheader' colspan='2'>Availability</td></tr>";
                            echo"<tr><td width='30%'>No of copies available: </td><td class='detail'>"."$copyNo"."</td></tr>";
                            echo"<tr><td width='20%'>Available at: </td><td class='detail11'>"."$location"."</td></tr>";
                            echo"<tr><td width='20%'>Status: </td><td class='detail'>"."$status"."</td></tr>";
                            echo"<tr><td width='20%'>Number of Days that can be out: </td><td class='detail'>"."$noOfDays"."</td></tr>";
                            
                            echo"</table>";
                        ?>
                        <table align='center'><tr><td>
                        <input type='submit' value='RESERVE' class='tool'>
                        </td></tr></table>
                        </form>
                        </td></tr>
                        
                
                <tr>
                <td colspan='2' class='outerframe2'><?php require('contact.php'); ?></td></tr>
                </table>
        </td></tr></table>
    </body>
</html>

